<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="common/include :: header('新增服务项')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-post-add" th:object="${employee}">
        <input id="id" type="hidden" name="id" th:field="*{id}"/>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">姓名：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="name" id="postName" th:field="*{name}" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">邮箱：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="email" id="postCode" th:field="*{email}" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">年龄：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="age" id="postSort" th:field="*{age}" required>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">性别：</label>
            <div class="col-sm-8">
                <div class="radio-box" th:each="dict : ${@dict.getType('sys_user_sex')}">
                    <input type="radio" th:id="${dict.id}" name="sex" th:field="*{sex}" th:value="${dict.value}"
                           th:checked="${dict.isDefault}">
                    <label th:for="${dict.id}" th:text="${dict.label}"></label>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">是否超管：</label>
            <div class="col-sm-8">
                <div class="radio-box" th:each="dict : ${@dict.getType('si_visible')}">
                    <input type="radio" th:id="${dict.id}" name="admin" th:value="${dict.value}" th:field="*{admin}"
                           th:checked="${dict.isDefault}">
                    <label th:for="${dict.id}" th:text="${dict.label}"></label>
                </div>
            </div>
        </div>
        <li>
            所在部门：
            <select name="deptId">
                <option value="">所有</option>
                <option th:each="dict:${dept}" th:field="*{deptId}" th:text="${dict.name}"
                        th:value="${dict.id}"></option>
            </select>
        </li>
    </form>
</div>
<th:block th:include="common/include :: footer"/>
<script type="text/javascript">
    var prefix = ctx + "/business/employee";

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-post-add').serialize());
        }
    }
</script>
</body>
</html>
